import {reqGetCodeInfo,reqToDoregisterInfo} from '@/api'
const actions = {
    async getcode({commit},phone){
        let result = await reqGetCodeInfo(phone)
        if(result.code==200){
            commit('GETCODE',result.data)
        }
            
           
        
    },
    async togister({commit},data){
        let result = await reqToDoregisterInfo(data)
        console.log(result)
        if(result.code==200){
            return 'ok'
        }else{
            return Promise.reject(new Error('faile'))
        }


    }

}
const mutations = {
    GETCODE(state,value){
        state.code = value

    }

}
const state = {
    code:''

}
export default{
    actions,
    mutations,
    state

}